/* abm.css */
/* Styles for Auto Build Marlin Home - and eventually Configurator */

* {
  --abm-header-height: 50px;
  --abm-toolbar-width: 70px;
  --abm-social-width: 40px;
  --abm-footer-height: 40px;
  --abm-font-size-caption: small;
  }

body.vscode-dark {
  --abm-background: #282C34;
  --abm-toolbar-bg: #333636;
  --abm-color-border: #CCC;
  --abm-tool-bg-hover: #666;
  --abm-tool-bg-active: #4D73B9;
  --abm-text-color-label: #827461;
  --abm-text-color-data: #FFE;
  --abm-text-color-pale: #8A8;
  --abm-text-color-good: #6E6;
  --abm-text-color-limbo: #DB6;
  --abm-text-color-busy: #FA0;
  --abm-text-color-error: #C44;
  --abm-text-color-caption: #58A;
  --abm-color-progress-border: #FFF;
  }

body.vscode-light {
  --abm-background: #DEF;
  --abm-toolbar-bg: #BCD;
  --abm-color-border: #888;
  --abm-tool-bg-hover: #666;
  --abm-tool-bg-active: #4D73B9;
  --abm-text-color-label: #3C2200;
  --abm-text-color-data: #365;
  --abm-text-color-pale: #45F;
  --abm-text-color-good: #00D000;
  --abm-text-color-limbo: #A80;
  --abm-text-color-busy: #A05900;
  --abm-text-color-error: #C00;
  --abm-text-color-caption: #005B98;
  --abm-color-progress-border: #000;
  }

body.vscode-high-contrast {
  --abm-background: #282C34;
  --abm-toolbar-bg: #333636;
  --abm-color-border: #666;
  --abm-tool-bg-hover: #666;
  --abm-tool-bg-active: #4D73B9;
  --abm-text-color-label: #827461;
  --abm-text-color-data: #FFE;
  --abm-text-color-pale: #8A8;
  --abm-text-color-good: #6E6;
  --abm-text-color-limbo: #DB6;
  --abm-text-color-busy: #FA0;
  --abm-text-color-error: #C44;
  --abm-text-color-caption: #58A;
  }

/* Styles based on theme variant. Where to get a set of hues? */

.clear { clear: both; }

body {
  --abm-progress-offset: 0px;
  margin: 0;
  padding: 0;
  background: var(--abm-background);
  color: var(--abm-text-color-data);
  }

a { text-decoration: none; color: #478EFF; }
a:hover, a:active { color: #579EFF; }

h1 {
  padding: 10px;
  margin: 0 0 4px;
  background: var(--abm-toolbar-bg);
  color: #FFFFF8;
  }

h1 span { font-size: 66%; }

h2 { text-align: center; }

* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  }
pre {
  -webkit-touch-callout: text;
  -webkit-user-select: text;
  -khtml-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  }

.lcall, .rcall {
  float: right;
  border: 2px solid #666;
  padding: 1px;
  }
.lcall {
  float: left;
  margin: 0 0.5em 0.5em 4px;
  }
.rcall {
  float: right;
  margin: 0 4px 0.5em 0.5em;
  }

.col1   { float: left; width:  33%; }
.col12  { float: left; width:  66%; }
.col123 { float: left; width: 100%; }

/* CSS Grid Layout */

#abm-layout {
  position: relative;
  display: grid;
  grid-template-columns: var(--abm-toolbar-width) 1fr var(--abm-social-width);
  grid-template-rows: var(--abm-header-height) 1fr var(--abm-footer-height);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  min-height: 100vh;
  background: var(--marlin-svg) transparent no-repeat fixed center;
  background-size: 55%;
  }

#abm-toolbar { grid-area: 1 / 1 / 4 / 2; }
.abm-tool   { grid-area: 1 / 2 / 3 / 3; display: none; }
#abm-sidebar { grid-area: 1 / 3 / 3 / 4; }
#abm-footer  { grid-area: 3 / 2 / 4 / 4; }

#abm-toolbar {
  background: var(--abm-toolbar-bg);
  color: #FFFFF8;
  text-align: center;
  }

#abm-icon img { padding: 10px 0 5px; }

.abm-tool>div { margin: 10px; }

#abm-top { float: right; }

#abm-sidebar {
  background: var(--abm-toolbar-bg);
  color: #FFFFF8;
  }
#abm-sidebar img { display: inherit; }
#codecat { width: 100%; }

#abm-footer {
  padding-top: 20px;
  text-align: center;
  background: var(--abm-toolbar-bg);
  color: #79820E;
  }
#abm-footer span { position: relative; top: -0.6em; }

table#info {
  font-size: 14pt;
  margin-bottom: 0.5em;
  }
table#info>tbody>tr>th,
table#info>tbody>tr>td { padding: 4px; vertical-align: top; }
table#info>tbody>tr>th {
  text-align: right;
  white-space: nowrap;
  color: var(--abm-text-color-label);
  }

#info div>span { color: var(--abm-text-color-pale); }


/* Button Styles */

button { cursor: pointer; outline: none; }
button img { vertical-align: text-bottom; }

#abm-toolbar button, #abm-social a {
  display: inline-block;
  width: 100%;
  background: none;
  color: #FFF;
  font-size: small;
  margin: 0 0 0.5em;
  border: none;
  opacity: 0.7;
  }
#abm-toolbar button img, #abm-social a>img { padding: 0.25em 0; }
#abm-toolbar button span { display: block; padding-bottom: 0.25em; }
#abm-toolbar button:active,
#abm-toolbar button.active:hover,
#abm-toolbar button.active {
  background: var(--abm-tool-bg-active);
  opacity: 1.0;
  }
#abm-toolbar button:hover { background: var(--abm-tool-bg-hover); }

/* Blend Modes for middle-gray SVG */
#abm-toolbar button * { color: #808080; mix-blend-mode: color-dodge; }
#abm-toolbar button:hover * { mix-blend-mode: difference; }
#abm-toolbar button:active *,
#abm-toolbar button.active:hover *,
#abm-toolbar button.active * { mix-blend-mode: color-dodge; }

#info button>img, #abm-top button>img {
  width: 1.1em;
  height: 1.1em;
  margin-top: 2px;
  font-size: 90%;
  }

#abm-social { padding-top: var(--abm-header-height); margin-top: 2em; }
#abm-social a { display: block; width: 70%; padding: 0 15%; margin: 0 auto 0.5em; }
#abm-social a>span { display: none; }
#abm-social a:hover { background: var(--abm-tool-bg-hover); opacity: 1; }

.abm-tool button {
  background: rgba(1, 107, 120, 0.5);
  color: #FFF;
  font-size: 12pt;
  padding: 0 6px;
  border: 2px solid rgba(1, 107, 120, 0.15);
  border-radius: 0.4em;
  margin: 0 0.5em 0.25em 0;
  }
.abm-tool button:hover { background: rgba(1, 107, 120, 1); }

pre.config {
  opacity: 0.5;
  max-height: 60vh;
  max-width: 60vw;
  padding: 10px;
  overflow: auto;
  clear: both;
  background-color: #FFF;
  color: #000;
  font-family: "Fira Mono", monospace;
  font-size: small;
  }

.abm-caption {
  font-size: var(--abm-font-size-caption);
  color: var(--abm-text-color-caption);
  margin: 0;
  }

/* Environment Caption cell */
.env-more {
  display: none;
  position: relative;
  top: -12px;
  }
.env-more span {
  height: 0;
  margin-left: 1em;
  }
/* Show the caption for exists or busy */
.exists          .env-more,
.busy            .env-more { display: table-cell; }
/* Italic caption when busy */
.busy            .env-more { font-style: italic; }
/* The incomplete (when not busy) color */
.incomplete      .env-more { color: var(--abm-text-color-error); }
/* The busy color */
.busy            .env-more,
.incomplete.busy .env-more { color: var(--abm-text-color-busy); }

/* Environments Sub-Table */
table#info>tbody>tr>td#info-envs { padding: 0; } /* Envs Cell */
#info-envs table td+td { padding-left: 1em; }    /* Buttons Cell */
#info-envs table td { padding-bottom: 8px; vertical-align: top; }

/* Environment Name Colors */
#info-envs              .env-name { color: var(--abm-text-color-limbo); }
#info-envs .exists      .env-name { color: var(--abm-text-color-good); }

#info-envs .busy        .env-name,
#info-envs .busy.exists .env-name { color: var(--abm-text-color-busy); }

#info-envs .exists.incomplete .env-name { color: var(--abm-text-color-error); }

/* Environment Action Buttons */

/* Show CLEAN for existing build */
#info-envs         button.clean { display: none; }
#info-envs .exists button.clean { display: inline-block; }

/* Only show 'Upload' or 'Debug' depending on the env */
                  button.debug { display: none; }
#info-envs .debug button.debug { display: inline-block; }
#info-envs .debug button.upload,
#info-envs .native button.upload { display: none; }

/* Only show the "Run" button for a Native target */
#info-envs                button.run { display: none; }
#info-envs .exists.native button.run { display: inline-block; }

/* Hide ALL buttons when busy */
#info-envs .busy button,
#info-envs .busy.exists button,
#info-envs .busy.exists button.clean,
#info-envs .busy.exists button.debug,
#info-envs .busy.exists button.run { display: none; }

/* Show busy indicator when busy */
#info-envs       span.progress { display: none; }
#info-envs .busy span.progress { display: inline-block; }

/* Hide buttons template and debug text field */
#env-rows-src,
#debug-text { display: none; }

#error, div.panel-err {
  width: 70%;
  margin: 1em auto;
  padding: 0.5em 0;
  border: 2px solid #FFB4B2;
  border-radius: 1.25em;
  text-align: center;
  font-size: large;
  color: #FFB4B2;
  background: #790000;
  }

#error { display: none; }

span.progress {
  display: inline-block;
  width: 128px;
  height: 0.5em;
  border: 1px solid var(--abm-color-progress-border);
  border-radius: 0.25em;
  background-color: #FF6;
  background-image: url(progress.gif);
  background-position-x: var(--abm-progress-offset);
  background-repeat: repeat-x;
  }

.subpanes>div {
  display: none;
  width: 100%;
  min-height: 400px;
  border: 1px solid var(--abm-color-border);
  background: #FFF3;
  }

.panel-error {
  text-align: center;
  color: red;
  font-size: 150%;
  }

div.subtabs { margin-bottom: 0; }
div.subpanes { margin-top: 0; }
div.subtabs button {
  border-radius: 0.25em 0.25em 0 0;
  margin: 0 2px 0 0;
  color: #EEE;
  }
div.subtabs button.active {
  background: #3BB175;
  color: #FFF;
  }

a.reveal { font-size: 120%; }
